<template>
    <div class="goodsinfo-container">
        <h3>{{info.title}}--{{id}}</h3>
        <hr>
        <div class="content" v-html="info.content"></div>
        <hr>
        <cmt-box :id="id"></cmt-box>
    </div>
</template>
<script>
import Comment from '../subcomponents/Comment.vue';

export default{
    data(){
        return {
            info:{}
        }
    },
    methods:{
        getInfo(){
            this.$http.get(`api/goods/getdesc/${this.id}`).then((res)=>{
                if(res.body.status==0){
                    this.info=res.body.message[0];
                    console.log(this.info);
                }
            });
        }
    },
    created(){
        this.getInfo();
    },
    components:{
        'cmtBox':Comment
    },
    props: ['id'],
}
</script>
<style lang="scss">
.goodsinfo-container{
    
    h3{
        font-size: 18px;
        padding:4px;
    }
    hr{
        border:.6px solid #DDD;
    }
    .content{
        padding:4px;
        img{
            width: 100%;
        }
    }
}

</style>